﻿<%@ Page Language="C#" MasterPageFile="~/Theme/Stander/Stander.master" AutoEventWireup="true" CodeFile="IncomeRecord.aspx.cs" Inherits="Bill_IncomeRecord" Title="编辑收款单－－财务部" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
<asp:Button ID="btnBack" runat="server" Text="返回上一级" CausesValidation="False" OnClick="btnBack_Click" />
<fieldset>
    <legend>编辑收款单</legend>
    <div class="info"><asp:Label ID="lblOrderId" runat="server" Visible="false"></asp:Label>
       <label>收款单位: </label><asp:Label ID="lblIncomeUnit" runat="server" CssClass="infoColumn"></asp:Label>
       <label>对应的媒介: </label>
       <asp:Label ID="lblMediaName" runat="server" CssClass="infoColumn"></asp:Label><br /><br />
       <table><tr>
       <td><label>应收款: </label><asp:Label ID="lblFinalRealIncome" CssClass="infoColumn" runat="server"></asp:Label></td>
       <td><label>已收款: </label><asp:Label ID="lblAlreadyIncome" CssClass="infoColumn" runat="server"></asp:Label></td>
       <td><label>清单状态:</label></td><td><asp:Image ID="imgBillAudit" runat="server" />&nbsp;&nbsp;</td>
       <td><label>客户订单状态:</label></td><td><asp:Image ID="imgCustomerAudit" runat="server" /></td>
       </tr></table>
    </div>
</fieldset>
<h1 class="block"><asp:Label ID="lblListName" runat="server" Text="该订单的收款记录"></asp:Label></h1>
<asp:GridView ID="IncomeRecordsGridView" runat="server" AllowPaging="True" 
    AutoGenerateColumns="False" CssClass="normal mouseOver" DataKeyNames="Id" 
    OnRowDataBound="IncomeRecordsGridView_RowDataBound" 
    OnRowDeleting="IncomeRecordsGridView_RowDeleting">
    <Columns>
        <asp:BoundField DataField="Id" HeaderText="收款单号" InsertVisible="False"
            ReadOnly="True" SortExpression="IncomeRecordId" >
            <ItemStyle BorderWidth="1px" />
        </asp:BoundField>
        <asp:TemplateField HeaderText="收款单位">
            <ItemTemplate>
                <asp:Label ID="lblIncomeUnit" runat="server"></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:BoundField DataField="Income" HeaderText="收款金额" 
            SortExpression="Income" DataFormatString="{0:c}" HtmlEncode="False" >
        </asp:BoundField>
        <asp:BoundField DataField="IncomeDate" DataFormatString="{0:d}" HeaderText="收款日期"
            SortExpression="IncomeDate" HtmlEncode="False" >
        </asp:BoundField>
        <asp:BoundField DataField="Description" HeaderText="财务备注" SortExpression="Description" >
        </asp:BoundField>
        <asp:HyperLinkField DataNavigateUrlFields="Id,OrderId" 
            DataNavigateUrlFormatString="IncomeRecord.aspx?IncomeRecordId={0}&OrderId={1}"
            Text="修改" >
        </asp:HyperLinkField>
        <asp:TemplateField ShowHeader="False">
            <ItemTemplate>
                <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Delete"
                    Text="删除" OnClientClick='return confirm("你确定删除该记录吗？");'></asp:LinkButton>
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
    <EmptyDataTemplate>
        暂无任何记录.
    </EmptyDataTemplate>
</asp:GridView>
<asp:ObjectDataSource ID="odsSelectIncomeRecordByOrderId" runat="server" SelectMethod="GetIncomeRecordsByOrderId"
    TypeName="Active.Core.Service.DataService">
    <SelectParameters>
        <asp:QueryStringParameter Name="orderId" QueryStringField="OrderId" Type="Int32" />
    </SelectParameters>
</asp:ObjectDataSource>

<fieldset id="IncomeRecordEditFieldset" runat="server">
    <legend id="lblTitle" runat="server">订单新增收款</legend>
    <table cellpadding="0" cellspacing="0" style="width: 100%" >
        <tr style="text-align: center" >
            <td style="width: 105px; height: 31px; text-align: right;">
                收款金额：</td>
            <td style="width: 125px; height: 31px; text-align: left;">
          <asp:TextBox ID="txtIncome" runat="server" Width="85px" Height="15px" ForeColor="#0066FF"></asp:TextBox>
                <asp:RequiredFieldValidator ID="valrIncome" runat="server" ControlToValidate="txtIncome"
                    Display="Dynamic" ErrorMessage="必须填写金额"></asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtIncome"
                    Display="Dynamic" ErrorMessage="必须为数字" ValidationExpression="[0-9.]*"></asp:RegularExpressionValidator></td>
            <td style="width: 98px; height: 31px; text-align: right;">
                财务备注：</td>
            <td style="text-align: left;" colspan="2" rowspan="2">
          <asp:TextBox ID="txtDescription" runat="server" Width="358px" ForeColor="#0066FF" Height="62px" TextMode="MultiLine"></asp:TextBox></td>
        </tr>
        <tr>
            <td style="height: 38px; margin-top: 0px; left: 0px; margin-bottom: 0px; padding-bottom: 0px; width: 105px; padding-top: 0px; top: 0px; text-align: right;">
                收款日期：</td>
            <td style="width: 125px; height: 38px; margin-top: 0px; left: 0px; margin-bottom: 0px; padding-bottom: 0px; padding-top: 0px; top: 0px;">
                            <asp:TextBox ID="txtIncomeDate" runat="server" Width="85px" Height="15" ForeColor="#0066FF"></asp:TextBox>
                            <asp:ImageButton ID="selectDateImageBtn" runat="server" alt="选择日期" ImageUrl="../theme/stander/img/calendar.png" OnClientClick="return false;" />
                <asp:RequiredFieldValidator ID="valrDate" runat="server" ControlToValidate="txtIncomeDate"
                    Display="Dynamic" ErrorMessage="日期不能为空"></asp:RequiredFieldValidator>
                <asp:CompareValidator ID="valcDate" runat="server" ControlToValidate="txtIncomeDate"
                    Display="Dynamic" ErrorMessage="日期格式不对" Operator="DataTypeCheck" Type="Date"></asp:CompareValidator></td>
            <td style="height: 38px; margin-top: 0px; left: 0px; margin-bottom: 0px; padding-bottom: 0px; width: 98px; padding-top: 0px; top: 0px;">
          </td>
        </tr>           
         <tr>
             <td colspan="5">
        <asp:Button ID="btnSaveIncomeRecord" runat="server" Text="确认收款" 
            OnClick="btnSaveIncomeRecord_Click" 
            OnClientClick='if(!confirm("确认信息并保存?")) return false;' />
        <asp:Button ID="btnNew" runat="server" Text="取消修改" 
            OnClick="btnNew_Click" Visible="False" CausesValidation="False" /></td>
         </tr>
    </table>
</fieldset>
 <ajaxToolkit:CalendarExtender ID="defaultCalendarExtender" runat="server" 
    Format="yyyy-M-d" PopupButtonID="selectDateImageBtn" TargetControlID="txtIncomeDate">
</ajaxToolkit:CalendarExtender>
<ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server" 
    Format="yyyy-M-d" TargetControlID="txtIncomeDate">
</ajaxToolkit:CalendarExtender>
</asp:Content>